<template>
  <el-container ref='container' class="Layout">
    <ecp-menu/>
    <el-main class="Layout_main">
      <nuxt-child/>
    </el-main>
  </el-container>
</template>

<script>
  import { nologin } from "~/middleware/logincheck"
  import ecpMenu from '~/components/ecpMenu'
  import {mapMutations} from 'vuex'
  export default {
    middleware: nologin,
    components: {ecpMenu},
    mounted() {
      // 设置contain的高度
      const height = document.documentElement.clientHeight
      this.$refs.container.$el.style.height = height+'px'
      this.SET_INNER_HEIGHT(height)
    },
    methods: {
      ...mapMutations(['SET_INNER_HEIGHT'])
    }
  }
</script>

<style lang="scss" scoped>
.Layout {
  min-height: 100vh;
  min-width: 1366px;
  &_left {
    width: 86px;
    background-color: #333856;
    position: relative;
    &_contain {
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
    }
  }
  &_avatar {
    width: 44px;
    border-radius: 50%;
    margin-left: 21px;
    overflow: hidden;
    &_img {
      width: 100%;
      vertical-align: middle;
    }
  }
  &_more {
    color: #fff;
    text-align: center;
    width: 100%;
    height: 50px;
    line-height: 50px;
    &_icon {
      font-size: 32px;
      vertical-align: middle;
    }
  }
  &_main {
    border-left: 1px solid #e0e0e0;
    padding: 0;
    background: #f5f6fa;
  }
}
</style>
